﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.cruxomatic.configuration.DTOs;
using com.cruxomatic.DTOs;

namespace com.cruxomatic.security
{

    public interface ICruxSecurityManager
    {
        bool AuthenticateUser(string UserName, string Password, string CompanyName);

        bool AuthenticateUser(string UserName, string Password);

        UserInformation GetUserFromCompany(string UserName, string CompanyName);

        List<RoleInformation> GetRolesForUser(string UserName, string CompanyName);

        bool IsUserInRole(string UserName, string CompanyName, string RoleName);

        bool IsUserInRole(string UserName, string CompanyName, List<string> RoleNames);

        bool HasAccessToView(string UserName, string CompanyName, string ViewName);

        List<NavigationInformation> GetNavigationItemsForUser(string UserName, string CompanyName);

        List<string> GetAllRoles(int CompanyID);

        bool IsUserSuperAdminOrCompanyAdmin(UserInformation currentuser, int CompanID);

        bool IsUserSuperAdministrator(UserInformation userInformation);

        bool IsUserAuthorizedToEditUser(UserInformation currentUser, UserInformation userBeingModified);

        bool IsUserAdministrator(UserInformation userInformation);

        CompanyInformation GetCompayByUser(string UserName);

        bool IsUserAuthorizedToChangePassword(UserInformation currentUser, UserInformation userBeingModified);

        List<UserInformation> GetUsersByRole(List<string> RoleName);

        string GetApplicationPath();

        bool DoesUserHavePrivilage(UserInformation user, string PrivilageName);

        List<string> GetRolesByPrivilage(string PrivilageName);

        List<ViewInformation> GetInternalViewsForUser(string UserName, string CompanyName, string sectionName);

        //DashboardInformation GetDashboard(string dashboardName);

        DashboardInformation GetDashboard(string UserName, string CompanyName, string dashboardName);

        List<UserInformation> GetAllUsers();

        UserInformation GetUser(int UserID);

        List<UserInformation> GetUsers(int CompanyID);

        UserInformation GetUser(string UserName);

        CompanyInformation GetCompany(string CompanyName);

        CompanyInformation GetCompany(int CompanyID);

        List<CompanyInformation> GetAllCompanies();

        List<CompanyInformation> GetAllExternalCompanies();

        List<RoleInformation> GetAllRoles();

        List<CompanyTypeInformation> GetAllCompanyTypes();

        List<RoleInformation> GetAllRolesByCompanyID(int CompanyID);

        List<RoleInformation> GetNonSuperAdminisativeRoles(int CompanyID);

        List<RoleInformation> GetRolesForUser(int userid);

        bool IsCompanyInternal(int CompanyID);

        List<CompanyInformation> GetCompaniesForUser(int userid);
        int GetCompanyCountForUser(int userid);

        List<CompanyInformation> GetComapniesForUser(string UserName);
        void AssignCompaniesToUser(int p, List<CompanyInformation> selectedCompanies);

        void ModifyUserDetails(UserDetailsInformation userDetailInformation, int companyID);

        int DaysRemainingForPasswordExpiration(string userName);
        bool ResetPasswordRequired(string userName);
        void SetLastLoginTime(int userId);
        bool ValidateUser(string userName);
        bool IsUserGlobalAdministrator(UserInformation CurrentUser);
        List<RoleInformation> GetNonGlobalAdminisativeRoles(int Companyid);
        List<CompanyInformation> GetAllManagableCompanies(UserInformation user);
    }
}
